import request from '../utils/request.js'

export function login(params) {
  return request({
    // url: '/pc/user/login',
    url: '/user/getUser',
    method: 'post',
    data: params
  })
}
/**
 * 个人中心更新用户名称
 * 用户列表的信息更新
 */
export function editUser(param) {
  return request({
    url: '/user/updateUser',
    method: 'post',
    data: param
  })
}
//修改密码请求
export function editPass(params){
  return request({
    url: '/user/updatePwd',
    method: 'post',
    data: params
  })
}

export function addUser(params) {
  return request({
    url: '/user/addUser',
    method: 'post',
    data: params
  })
}
export function getOne(params) {
  return request({
    url: '/user/getOne',
    method: 'post',
    data: params
  })
}
//获取用户列表
export function getUserData(params) {
  return request({
    // url: '/pc/user/login',
    url: '/user/list',
    method: 'post',
    data: params
  })
}

//将用户置为有效无效
export function deleteuser(params) {
  return request({
    url: '/user/delUser',
    method: 'post',
    data: params
  })
}

//为用户修改添加页面获取角色列表
export function getRoleforUser(params) {
  return request({
    url: '/user/getRoleforUser',
    method: 'post',
    data: params
  })
}

//获取角色列表
export function getRole(params) {
  return request({
    url: '/role/getAll',
    method: 'get',
    data: params
  })
}
//角色置为无效
export function delrole(params) {
  return request({
    url: '/role/delRole',
    method: 'post',
    data: params
  })
}
//模糊查询，角色不查了
export function searchRole(params) {
  return request({
    url: '/role/getRole',
    method: 'get',
    data: params
  })
}

export function sendSMS(params) {
  return request({
    url: '/pc/sendsms',
    method: 'get',
    params: params
  })
}
